﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;

namespace PasteLoggerBoard.usermodels
{
    /// <summary>
    /// 
    /// </summary>
    public class UserInfoAddDto
    {

        ///<summary>
        ///用户名
        ///</summary>
        [MaxLength(32, ErrorMessage = "用户名过长，不能超过32位")]
        [Required(ErrorMessage = "用户名不能为空")]
        public string UserName { get; set; }

        /// <summary>
        /// 用户头像
        /// </summary>
        [MaxLength(128)]
        public string UserHead { get; set; }

        ///<summary>
        ///描述
        ///</summary>
        [MaxLength(64)]
        public string Desc { get; set; }

        ///<summary>
        ///邮箱
        ///</summary>
        [RegularExpression("[0-9,a-z]{1,24}@[a-z,0-9]{2,12}.[a-z]{2,5}", ErrorMessage = "账号格式有误xxx(1-24)@xxx(2-12).xxx(2-5)")]
        [Required(ErrorMessage = "邮箱不能为空！")]
        public string Email { get; set; }

        ///<summary>
        ///密码
        ///</summary>
        [RegularExpression("[a-z,A-Z,0-9]{3,16}", ErrorMessage = "密码规则错误，必须为字母或数字的组合,3到16位数!")]
        [Required(ErrorMessage = "密码不能为空")]
        public string PassWord { get; set; }

        /// <summary>
        /// 扩展 划定部门
        /// </summary>
        public int[] partids { get; set; }

        ///<summary>
        ///哪个角色？
        ///</summary>
        [MaxLength(16)]
        public string Grade { get; set; }
    }
    /// <summary>
    /// 
    /// </summary>
    public class UserInfoDto : EntityDto<int>
    {

        ///<summary>
        ///用户名
        ///</summary>
        [MaxLength(32)]
        public string UserName { get; set; }

        /// <summary>
        /// 用户头像
        /// </summary>
        [MaxLength(128)]
        public string UserHead { get; set; }

        ///<summary>
        ///创建日期
        ///</summary>
        public DateTime CreateDate { get; set; }

        ///<summary>
        ///描述
        ///</summary>
        [MaxLength(64)]
        public string Desc { get; set; }

        ///<summary>
        ///邮箱
        ///</summary>
        [MaxLength(64)]
        public string Email { get; set; }

        ///// <summary>
        ///// 扩展，所属部门岗位
        ///// </summary>
        //public List<PartInfoListDto> Parts { get; set; }

        ///<summary>
        ///状态
        ///</summary>
        public bool IsEnable { get; set; }

        ///<summary>
        ///哪个角色？
        ///</summary>
        [MaxLength(16)]
        public string Grade { get; set; }

        public int GradeId { get; set; } = 0;
    }
    /// <summary>
    /// 
    /// </summary>
    public class UserInfoListDto : EntityDto<int>
    {

        ///<summary>
        ///用户名
        ///</summary>
        [MaxLength(32)]
        public string UserName { get; set; } = "unknow";
        /// <summary>
        /// 用户头像
        /// </summary>
        [MaxLength(128)]
        public string UserHead { get; set; }
        ///<summary>
        ///哪个角色？
        ///</summary>
        [MaxLength(16)]
        public string Grade { get; set; } = "unknow";

        /// <summary>
        /// 扩展 是否绑定当前对象 用于项目参与人 部门(组别)人员
        /// </summary>
        public bool BoolBind { get; set; } = false;

        /// <summary>
        /// 
        /// </summary>
        public DateTime CreateDate { get; set; }
        ///<summary>
        ///描述
        ///</summary>
        [MaxLength(64)]
        public string Desc { get; set; }

        ///<summary>
        ///邮箱
        ///</summary>
        [MaxLength(64)]
        public string Email { get; set; }

        ///// <summary>
        ///// 扩展 所属部门
        ///// </summary>
        //public List<PartInfoListDto> Parts { get; set; }

        ///<summary>
        ///状态
        ///</summary>
        public bool IsEnable { get; set; }

    }
    /// <summary>
    /// 
    /// </summary>
    public class UserInfoUpdateDto : EntityDto<int>
    {

        ///<summary>
        ///用户名
        ///</summary>
        [MaxLength(32, ErrorMessage = "用户名过长，不能超过32位")]
        [Required(ErrorMessage = "用户名不能为空")]
        public string UserName { get; set; }
        /// <summary>
        /// 用户头像
        /// </summary>
        [MaxLength(128)]
        public string UserHead { get; set; }
        ///<summary>
        ///描述
        ///</summary>
        [MaxLength(64)]
        public string Desc { get; set; }

        ///<summary>
        ///邮箱
        ///</summary>
        [RegularExpression("[0-9,a-z]{1,24}@[a-z,0-9]{2,12}.[a-z]{2,5}", ErrorMessage = "账号格式有误xxx(1-24)@xxx(2-12).xxx(2-5)")]
        [Required(ErrorMessage = "邮箱不能为空！")]
        public string Email { get; set; }

        ///<summary>
        ///密码
        ///</summary>
        [RegularExpression("[a-z,A-Z,0-9]{3,16}", ErrorMessage = "密码规则错误，必须为字母或数字的组合,3到16位数!")]
        public string PassWord { get; set; }

        ///<summary>
        ///状态
        ///</summary>
        public bool IsEnable { get; set; }

        /// <summary>
        /// 扩展 部门ids
        /// </summary>
        public int[] partids { get; set; }

        ///<summary>
        ///哪个角色？
        ///</summary>
        [MaxLength(16)]
        public string Grade { get; set; }
    }
}
